<script setup>
import { ArrowRight } from '@element-plus/icons-vue';
import { computed } from 'vue';
import { useRoute } from 'vue-router';
//获取路由信息
const route = useRoute()
//
const breadcrumBList = computed(() => {
    return route.matched.filter(item =>
        item.path && item.path !== '/' && item.meta.title
    )
})
</script>
<template>
    <div class="bradcrumb">
        <el-breadcrumb :separator-icon="ArrowRight">
            <!-- <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item> -->
            <el-breadcrumb-item :to="{ path: '/'}">首页</el-breadcrumb-item>
            <el-breadcrumb-item v-for="(item, index) in breadcrumBList" :key="index">
                {{ item.meta.title }}
            </el-breadcrumb-item>
        </el-breadcrumb>
    </div>
</template>
<style scoped>
/* .bradcrumb {
    width: 97%;
    height: 15px;
    background-color: #fff;
    padding: 10px 15px;
} */
 .bradcrumb{
width: 100%;
height: 15px;
background: #fff;
padding: 15px 20px;
}
</style>